package concurrency.tij;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class SleepingTask extends LiftOff{
	
	public void run(){
		while(countDown-- > 0){
			System.out.println(status());
			try {
				TimeUnit.MILLISECONDS.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ExecutorService exe = Executors.newCachedThreadPool();
		for(int i = 0; i < 10; i++)
			exe.execute(new SleepingTask());
		
		exe.shutdown();
	}
}
